"""
Contains all the URL redirections associated to the contest application

"""
from django.conf.urls.defaults import *

from cassebras.contest.models import Slope, Category, Competitor

urlpatterns = patterns('',
    
    url(r'^competitors/$',  'django.views.generic.list_detail.object_list', 
                    dict(queryset=Competitor.objects.all().order_by('number'), 
                    template_object_name='competitor'), name='competitors'),
    
    url(r'^competitors/(?P<competitor_id>\d+)/$', 
                        'cassebras.contest.views.edit_competitor', name='competitor'),
    
    url(r'^categories/$',  'django.views.generic.list_detail.object_list', 
                    dict(queryset=Category.objects.all(), 
                    template_object_name='category'), name='categories'),

    url(r'^categories/(?P<object_id>\d+)/$', 
                    'django.views.generic.list_detail.object_detail', 
                    dict(queryset=Category.objects.all(), template_object_name='category'), 
                    name='category'),
                        
    url(r'^search/$', 'cassebras.contest.views.search', name='search'),
    
    url(r'^contest/$', 'cassebras.contest.views.show_contest', name='contest'),
    
    url(r'^slopes/$',  'django.views.generic.list_detail.object_list', 
                    dict(queryset=Slope.objects.all().order_by('number'), 
                    template_object_name='slope'), name='slopes'),
                    
    url(r'^slopes/(?P<object_id>\d+)/$', 
                    'django.views.generic.list_detail.object_detail', 
                    dict(queryset=Slope.objects.all(), template_object_name='slope'), 
                    name='slope'),
 
    (r'^$', 'cassebras.contest.views.show_contest'),
)